package tt.dz.appserver.service.avro.testm;

import java.io.IOException;

import org.apache.avro.Protocol;
import org.apache.avro.Protocol.Message;
import org.apache.avro.Schema;
import org.apache.avro.io.Decoder;
import org.apache.avro.ipc.generic.GenericResponder;

public class RPCInterfaceService extends GenericResponder {

	public RPCInterfaceService(Protocol protocol) {
		super(protocol);
	}

	@Override
	public Object respond(Message message, Object request) throws Exception {
		return respond(message, request, this.getLocal());
	}

	@Override
	public Object readRequest(Schema actual, Schema expected, Decoder in) throws IOException {
		Object obj = super.readRequest(actual, expected, in);
		return obj;
	}

	protected Object respond(Message message, Object request, Protocol protocol) throws Exception {
		return null;
//		transObj transObj = new transObj();
//		transObj.setUsername("123");
//		transObj.setPassword("123456");
//		transObj.setIsSuccess("1");
//		transObj.setMsg("ok");
//		return transObj;
	}

}
